﻿<phone:PhoneApplicationPage
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"  
    x:Class="TM.QWeibo.Client.Setting"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"  Style="{StaticResource PageLayoutGrid}">
        <!--Pivot Control-->
        <controls:Pivot x:Name="ptSettingPivot"  Style="{StaticResource Pivot}" SelectionChanged="ptSettingPivot_SelectionChanged">
            <controls:Pivot.Title>
                <Grid Margin="0,12,0,12">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="24" Height="24" Style="{StaticResource AltmanLogo}" />
                        <TextBlock Text="Altman设置" FontSize="24" FontFamily="Microsoft YaHei"/>
                    </StackPanel>
                </Grid>
            </controls:Pivot.Title>
            <!--Pivot item one-->
            <controls:PivotItem Header="选项">
                <StackPanel>
                    <toolkit:ListPicker x:Name="lpPictureQuality"  Header="发微博时的图片质量" SelectionMode="Single" SelectionChanged="lpPictureQuality_SelectionChanged" Style="{StaticResource SettingListPicker}" Loaded="lpPictureQuality_Loaded">
                            <toolkit:ListPicker.HeaderTemplate>
                                <DataTemplate>
                                <TextBlock Text="{Binding}" Style="{StaticResource SettingTitleStyle}"/>
                                </DataTemplate>
                            </toolkit:ListPicker.HeaderTemplate>
                            <toolkit:ListPicker.ItemTemplate>
                                <DataTemplate>
                                <TextBlock Text="{Binding Key}" Style="{StaticResource SettingListPickerItem}"/>
                                </DataTemplate>
                            </toolkit:ListPicker.ItemTemplate>
                        </toolkit:ListPicker>
                    <toolkit:ListPicker x:Name="lpCheckUpdateStatus"   Header="应用主界面查新时间间隔" SelectionMode="Single" SelectionChanged="lpCheckUpdateStatus_SelectionChanged" Style="{StaticResource SettingListPicker}" Loaded="lpCheckUpdateStatus_Loaded">
                            <toolkit:ListPicker.HeaderTemplate>
                                <DataTemplate>
                                <TextBlock Text="{Binding}" Style="{StaticResource SettingTitleStyle}"/>
                                </DataTemplate>
                            </toolkit:ListPicker.HeaderTemplate>
                            <toolkit:ListPicker.ItemTemplate>
                                <DataTemplate>
                                <TextBlock Text="{Binding Key}" Style="{StaticResource SettingListPickerItem}"/>
                                </DataTemplate>
                            </toolkit:ListPicker.ItemTemplate>
                        </toolkit:ListPicker>
                    <toolkit:ListPicker x:Name="lpSchedule"   Header="退出后每30分钟查新一次（后台任务）" SelectionMode="Single"  SelectionChanged="lpSchedule_SelectionChanged"  Style="{StaticResource SettingListPicker}"  Loaded="lpSchedule_Loaded">
                        <toolkit:ListPicker.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding}" Style="{StaticResource SettingTitleStyle}"/>
                            </DataTemplate>
                        </toolkit:ListPicker.HeaderTemplate>
                        <toolkit:ListPicker.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Key}" Style="{StaticResource SettingListPickerItem}"/>
                            </DataTemplate>
                        </toolkit:ListPicker.ItemTemplate>
                    </toolkit:ListPicker>
                    <toolkit:ListPicker x:Name="lpExitConfirm"   Header="退出应用时请询问我" SelectionMode="Single"  SelectionChanged="lpExitConfirm_SelectionChanged" Style="{StaticResource SettingListPicker}" Loaded="lpExitConfirm_Loaded">
                        <toolkit:ListPicker.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding}" Style="{StaticResource SettingTitleStyle}"/>
                            </DataTemplate>
                        </toolkit:ListPicker.HeaderTemplate>
                        <toolkit:ListPicker.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Key}" Style="{StaticResource SettingListPickerItem}"/>
                            </DataTemplate>
                        </toolkit:ListPicker.ItemTemplate>
                    </toolkit:ListPicker>
                    <CheckBox x:Name="cbHubTile" Content="添加发新微瓦片" Tap="cbHubTile_Tap" Style="{StaticResource SettingCheckbox}"/>
                    <Button x:Name="btnClearAllCache" Content="清除缓存"  Style="{StaticResource AboutButton}" Click="btnClearAllCache_Click"/>
                </StackPanel>                                             
            </controls:PivotItem>
            <controls:PivotItem Header="主题">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <StackPanel  Grid.Row="0">
                        <TextBlock Text="点击色块选择主题后重启应用生效" />
                    </StackPanel>
                    <ListBox x:Name="themeListBox" Grid.Row="1" SelectionChanged="themeListBox_SelectionChanged">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Image Source="{Binding Value}" Width="434" Height="80" Margin="0,0,0,24" Stretch="UniformToFill">
                                </Image>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>

            </controls:PivotItem>
            <!--Pivot item two-->
            <controls:PivotItem Header="关于">
                <ScrollViewer>
                    <StackPanel>
                        <TextBlock x:Name="tbAppName" Text="" Style="{StaticResource AboutTitle}"/>
                        <TextBlock Text="基于腾讯微博开放API开发的第三方免费客户端"  Style="{StaticResource AboutText}"/>
                        <TextBlock Text="作者 @hwangzhiming" Style="{StaticResource AboutText}"/>
                        <TextBlock Text="官网 www.topming.com/app/altman" Style="{StaticResource AboutText}"/>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="邮箱 " Style="{StaticResource AboutText}"/>
                            <TextBlock x:Name="tbEmail" Text="hwangzhiming@gmail.com(点击发送邮件)"  Style="{StaticResource AboutLink}" Tap="tbEmail_Tap"/>
                        </StackPanel>
                        <TextBlock Text="申明"  Style="{StaticResource AboutTitle}"/>
                        <TextBlock Text="此版本适用于windows phone mango作业系统的智能手机设备。本软件仅用于学习交流，软件的下载安装完全免费，使用过程之中产生的数量流量费用，由运营商收取。本应用作者对altman拥有最终解释权。" Style="{StaticResource AboutText}"/>
                        <TextBlock Text="致谢"  Style="{StaticResource AboutTitle}"/>
                        <TextBlock Text="在此感谢所有altman的用户的支持，感谢各位的反馈和宝贵意见，感谢捐赠altman的热心人士。祝各位使用愉快！"  Style="{StaticResource AboutText}"/>
                        <TextBlock Text="其他"  Style="{StaticResource AboutTitle}"/>
                        <TextBlock Text="" x:Name="tbIpAddr"  Style="{StaticResource AboutText}"/>
                        <StackPanel Orientation="Horizontal">
                            <Button x:Name="btnFollow" Content="收听作者" Click="btnFollow_Click" Style="{StaticResource AboutButton}"/>
                            <Button x:Name="btnIssue" Content="反馈" Click="btnIssue_Click" Style="{StaticResource AboutButton}"/>
                            <Button x:Name="btnWebSite" Content="官网" Click="btnWebSite_Click" Style="{StaticResource AboutButton}"/>
                            <Button x:Name="btnRate" Content="评分" Click="btnRate_Click"  Style="{StaticResource AboutButton}"/>
                        </StackPanel>
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>
            <controls:PivotItem Header="帮助">
                <StackPanel Orientation="Vertical">
                    <toolkit:PerformanceProgressBar x:Name="loadingBar"  Width="400" Style="{StaticResource PerformanceProgressBarStyle}" HorizontalAlignment="Center" Background="White" />
                    <phone:WebBrowser x:Name="webBrowser"  IsScriptEnabled="True" Base="" />
                </StackPanel>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>